import store from '@/store'
export const imgError = {
  inserted(dom, binding) {
    dom.onerror = () => {
      dom.src = binding.value
    }
  }
}

export const has = {
  inserted(dom, binding) {
    function isCan(key) {
      return store.state.permission.roles.points.find(point => point === key)
    }
    if (!isCan(binding.value)) dom.remove()
  }
}
